import { App } from 'vue'

const allComponent = require.context('.', true, /Index\.vue$/)

export default {
  install(app: App) {
    allComponent.keys().forEach((path) => {
      const name = path.split('/')[1]
      // 注册全局组件
      app.component(name, allComponent(path).default)
    })
  }
}
